package spring.learn.core.ioc;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import spring.learn.core.ioc.data.PetService;
import java.util.Arrays;

public class UseAnnotation {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.scan("spring.learn.core.ioc.config");
        context.refresh();
        Arrays.asList(context.getBeanDefinitionNames()).forEach(System.out::println);
        PetService petService = context.getBean("petService", PetService.class);
        System.out.println(petService.getPetUserList());
    }
}
